
=== <%= feature['name'] %>

<%if feature.key?('description') %>
<%= feature['description'] %>
<% end %>

<%if feature.key?('background') %>==== <%= feature['background']['name'] %>
<%if feature['background'].key?('description') %>
<%= feature['background']['description'] %>
<% end %><%if feature['background'].key?('steps') %>
[.step-list]<% feature['background']['steps'].each do |step| %>
*<%= step['keyword'].strip %>* <%= step['name'] %><%if step.key?('doc_string') %>
+
....
<%= step['doc_string']['value'] %>
....
<% end %><%if step.key?('rows') %>
+<% if step['rows'].first && step['rows'].first.key?('cols') %>
[<%= step['rows'].first['cols'] %>]<% end %>
|====
<% step['rows'].each_with_index do |row, index| %><% row['cells'].each_with_index do |cell, i| %><%
  if row.key?('cell-styles') && row['cell-styles'].length > i %><%= row['cell-styles'][i] %><% end %>| <%= cell %> <% end %>
<% end %>|====
<% end %>

<% end %>
<% end %>

<%if feature['background'].key?('examples')
example = feature['background']['examples'] %>

===== <%= example['keyword'].strip %> <%= example['name'] %>

<% if example['rows'].first && example['rows'].first.key?('cols') %>
[<%= example['rows'].first['cols'] %>]<% end %>
|====
<% example['rows'].each_with_index do |row, index| %><% row['cells'].each_with_index do |cell, i| %><%
if row.key?('cell-styles') && row['cell-styles'].length > i %><%= row['cell-styles'][i] %><% end %>| <%= cell %> <% end %>
<% if index == 0 %>
<% end %><% end %>|====
<% end %>
<% end %>

<%if feature.key?('scenarios') %><% feature['scenarios'].each do |scenario| %>==== <%= scenario['name'] %>
<%if scenario.key?('description') %>
<%= scenario['description'] %>
<% end %><%if scenario.key?('steps') %>
[.step-list]<% scenario['steps'].each do |step| %>
*<%= step['keyword'].strip %>* <%= step['name'] %><%if step.key?('doc_string') %>
+
....
<%= step['doc_string']['value'] %>
....
<% end %><%if step.key?('rows') %>
+<% if step['rows'].first && step['rows'].first.key?('cols') %>
[<%= step['rows'].first['cols'] %>]<% end %>
|====
<% step['rows'].each_with_index do |row, index| %><% row['cells'].each_with_index do |cell, i| %><%
if row.key?('cell-styles') && row['cell-styles'].length > i %><%= row['cell-styles'][i] %><% end %>| <%= cell %> <% end %>
<% end %>|====
<% end %>

<% end %>
<% end %>

<%if scenario.key?('examples')
example = scenario['examples']
%>

===== <%= example['keyword'].strip %> <%= example['name'] %>

<% if example['rows'].first && example['rows'].first.key?('cols') %>
[<%= example['rows'].first['cols'] %>]<% end %>
|====
<% example['rows'].each_with_index do |row, index| %><% row['cells'].each_with_index do |cell, i| %><%
if row.key?('cell-styles') && row['cell-styles'].length > i %><%= row['cell-styles'][i] %><% end %>| <%= cell %> <% end %>
<% if index == 0 %>
<% end %><% end %>|====

<% end %>

<% end %>
<% end %>

